bitkeeper revision 1.790 (4051df63N_qhNLzJhUL0q78WetTFRg)
authorkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Fri, 12 Mar 2004 16:03:47 +0000 (16:03 +0000)
committerkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Fri, 12 Mar 2004 16:03:47 +0000 (16:03 +0000)
dev.c:
  Prevent transmitting link-local ARP packets on the wire.

xen/net/dev.c

index 3f3d317931837c73a90589c3fcb10e217faaad25..fbd9be63c96f4ffb3ede9e64885839c4b7591790 100644 (file)
@@ -1977,10 +1977,19 @@ static int get_tx_bufs(net_vif_t *vif)
              * some 169.254.* (ie. link-local) packets on the wire unless we 
              * include this explicit test. :-(
              */
-            if ( (ntohs(*(unsigned short *)(g_data + 12)) == ETH_P_IP) &&
-                 ((ntohl(*(unsigned long *)(g_data + 26)) & 0xFFFF0000) == 
-                  0xA9FE0000) )
-                goto disallow_linklocal_packets;
+            switch ( ntohs(*(unsigned short *)(g_data + 12)) )
+            {
+            case ETH_P_ARP:
+                if ( ((ntohl(*(unsigned long *)(g_data + 28)) & 0xFFFF0000) == 
+                      0xA9FE0000) )
+                    goto disallow_linklocal_packets;
+                break;
+            case ETH_P_IP:
+                if ( ((ntohl(*(unsigned long *)(g_data + 26)) & 0xFFFF0000) == 
+                      0xA9FE0000) )
+                    goto disallow_linklocal_packets;
+                break;
+            }
 
             stx = &vif->tx_shadow_ring[MASK_NET_TX_IDX(j)];
             stx->id     = tx.id;